<?php

	class Wp_ship_schedule_model extends CI_Model {

		protected $__tbname = 'wp_ship_schedule';
		protected $__dbconf = 'default';

		var $id;	//int(10) unsigned	Primary Key	Auto Increment	NOT NULL
		var $id_wp_country;	//int(10) unsigned			NOT NULL
		var $ship_name;	//varchar(255)			NOT NULL
		var $grt;	//double(10,2) unsigned			NOT NULL
		var $dwt = 0;	//int(10) unsigned			NULL
		var $date_time;	//datetime			NULL
		var $arriving_port;	//int(10)			NULL
		var $leaving_port;	//int(10)			NULL
		var $created_date;	//timestamp			NOT NULL
		var $modified_date;	//datetime			NULL
		var $type = 0;	//tinyint(1)			NULL
		var $loa;	//double(10,2) unsigned			NOT NULL
		var $goods;	//text			NULL
		var $advertiser;	//text			NULL
        var $id_wp_region = 0;	//int(10)			NULL
		var $draf;	//double(10,2) unsigned			NOT NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'int', 'null' => FALSE, 'auto_increment' => TRUE),
			'id_wp_country' => array('type' => 'int', 'null' => FALSE),
			'ship_name' => array('type' => 'varchar', 'size' => 255, 'null' => FALSE),
			'grt' => array('type' => 'double', 'null' => FALSE),
			'dwt' => array('type' => 'int', 'null' => TRUE),
			'date_time' => array('type' => 'datetime', 'null' => TRUE),
			'arriving_port' => array('type' => 'int', 'null' => TRUE),
			'leaving_port' => array('type' => 'int', 'null' => TRUE),
			'created_date' => array('type' => 'timestamp', 'null' => FALSE),
			'modified_date' => array('type' => 'datetime', 'null' => TRUE),
			'type' => array('type' => 'tinyint', 'null' => TRUE),
			'loa' => array('type' => 'double', 'null' => FALSE),
			'goods' => array('type' => 'text', 'null' => TRUE),
			'advertiser' => array('type' => 'text', 'null' => TRUE),
            'id_wp_region' => array('type' => 'int', 'null' => TRUE),
			'draf' => array('type' => 'double', 'null' => FALSE)
		);

		protected $__relation = array(
			array('table' => 'wp_country', 'foreign_key' => 'id_wp_country'),
            array('table' => 'wp_region', 'foreign_key' => 'id_wp_region')
		);
	}
